<?php

/**
 * ExamTest form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseExamTestForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'class_id'        => new sfWidgetFormPropelChoice(array('model' => 'Classes', 'add_empty' => false)),
      'test_id'         => new sfWidgetFormPropelChoice(array('model' => 'Test', 'add_empty' => false)),
      'et_name'         => new sfWidgetFormInput(),
      'et_start_time'   => new sfWidgetFormDateTime(),
      'et_student_join' => new sfWidgetFormInput(),
      'et_note'         => new sfWidgetFormTextarea(),
      'created_at'      => new sfWidgetFormDateTime(),
      'updated_at'      => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorPropelChoice(array('model' => 'ExamTest', 'column' => 'id', 'required' => false)),
      'class_id'        => new sfValidatorPropelChoice(array('model' => 'Classes', 'column' => 'id')),
      'test_id'         => new sfValidatorPropelChoice(array('model' => 'Test', 'column' => 'id')),
      'et_name'         => new sfValidatorString(array('max_length' => 45)),
      'et_start_time'   => new sfValidatorDateTime(),
      'et_student_join' => new sfValidatorInteger(),
      'et_note'         => new sfValidatorString(array('required' => false)),
      'created_at'      => new sfValidatorDateTime(array('required' => false)),
      'updated_at'      => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('exam_test[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ExamTest';
  }


}
